import { getData, postData } from "@/utils/request";


/**
 * 获取投票列表
 * 根据组织Id查询
 * @param {*} id 
 * @returns 
 */
export const getSurverList = async (orgId, page, pageSize) => {
    const allSurveyList = await postData('/serviceVote/queryVoteList', { orgId, page, pageSize });
    return allSurveyList;
};

/**
 * 查询投票详情
 * @param {*} voteId 
 * @returns 
 */
export const getSurveyDetail = async (voteId, partyId) => {
    const surveyDetail = await getData(`/serviceVote/queryVoteItemDetail/${voteId}/${partyId}`);
    return surveyDetail;
};

/**
 * 提交投票选择
 * @param {*} data 
 * @returns 
 */
export const submitVote = async (data) => {
    const submitMsg = await postData('/serviceVote/submitVote', data);
    return submitMsg;
};
